// src/router/index.ts
import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import Layout from '../views/Layout.vue'

// 定义路由配置
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        children: [
            {
                path: '/',
                name: 'Home',
                component: () => import('../views/index.vue')
            },
            {
                path: '/income/:skill',
                name: 'IncomeCalculator',
                component: () => import('../views/earnings.vue')
            },
            {
                path: 'about',
                name: 'About',
                component: () => import('../views/about.vue')
            }
        ]
    },
]

// 创建路由实例
const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router